import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
import './plugins/element.js'
Vue.use(Element, {
    size: 'small',
    zIndex: 3000
});

Vue.config.productionTip = false;

Vue.prototype.isStr = 'Vue.prototype上的isStr';

Vue.mixin({
    data() {
        return {
            g_https:"https://"
        }
    },
    mounted() {
    }
})

window.str = "window上的str";

new Vue({
    data(){
        return {
            dataStr:"App.vue中的data"
        }
    },
    router,
    store,
    render: h => h(App)
}).$mount("#app");

// beforeEach() 点击后先执行，再执行 afterEach()，然后跳转
router.beforeEach((to, from, next) => {
    // console.log("beforeEach()");
    // alert("beforeEach");
    next();
})
router.afterEach((to, from) => {
    // alert("afterEach");
    // console.log("afterEach()");
})



// router.beforeEach((to, from, next) => {
//     console.log(to,from);
//     next();
// })